//using FireStarterModeller.BO;
//using Habanero.BO;
//using NUnit.Framework;

//TODO  19 Feb 2009: 
//TODO: Change to Parameter
//namespace FireStarterModeller.Test.BO
//{
//    [TestFixture]
//    public class TestRule : TestBase
//    {
//        [SetUp]
//        public override void SetupTest()
//        {
//            //Runs every time that any testmethod is executed
//            base.SetupTest();
//        }

//        [TestFixtureSetUp]
//        public void TestFixtureSetup()
//        {
//            //Code that is executed before any test is run in this class. If multiple tests
//            // are executed then it will still only be called once.
//        }

//        [TearDown]
//        public override void TearDownTest()
//        {
//            //runs every time any testmethod is complete
//            base.TearDownTest();
//        }

//        [Test]
//        public void Test_InsertNewRule_Invalid()
//        {
//            //---------------Set up test pack-------------------
//            RuleInfo rule = new RuleInfo();

//            //---------------Assert Precondition----------------
//            Assert.IsTrue(rule.Status.IsNew);

//            //---------------Execute Test ----------------------
//            try
//            {
//                rule.Save();
//                Assert.Fail("expected Err");
//            }
//            //---------------Test Result -----------------------
//            catch (BusObjectInAnInvalidStateException ex)
//            {
//                StringAssert.Contains("Key' is a compulsory field and has no value", ex.Message);
//                StringAssert.Contains("Value' is a compulsory field and has no value", ex.Message);
//                StringAssert.Contains("Prop Rule Info I D' is a compulsory field and has no value", ex.Message);
//            }
//            Assert.IsTrue(rule.Status.IsNew);
//        }

//        [Test]
//        public void Test_InsertNewRule()
//        {
//            //---------------Set up test pack-------------------
//            RuleInfo rule = TestUtils.CreateUnsavedValidRule();

//            //---------------Assert Precondition----------------
//            Assert.IsTrue(rule.Status.IsNew);

//            //---------------Execute Test ----------------------
//            rule.Save();

//            //---------------Test Result -----------------------
//            Assert.IsFalse(rule.Status.IsNew);
//        }

//        [Test]
//        public void Test_DeleteRule()
//        {
//            //---------------Set up test pack-------------------
//            RuleInfo rule = TestUtils.CreateSavedRule();

//            //---------------Assert Precondition----------------
//            Assert.IsFalse(rule.Status.IsNew);
//            string message;
//            Assert.IsTrue(rule.IsDeletable(out message));

//            //---------------Execute Test ----------------------
//            rule.MarkForDelete();
//            rule.Save();

//            //---------------Test Result -----------------------  
//            Assert.IsTrue(rule.Status.IsNew);
//            Assert.IsTrue(rule.Status.IsDeleted);
//        }

//        [Test]
//        public void Test_UpdateRule()
//        {
//            //---------------Set up test pack-------------------
//            RuleInfo rule = TestUtils.CreateSavedRule();

//            //---------------Assert Precondition----------------
//            Assert.IsFalse(rule.Status.IsNew);
//            string message;
//            Assert.IsTrue(rule.IsEditable(out message));

//            //---------------Execute Test ----------------------
//            rule.Value = TestUtils.GetRandomString();
//            rule.Key = TestUtils.GetRandomString();
//            rule.Save();

//            //---------------Test Result -----------------------
//            Assert.IsFalse(rule.Status.IsNew);
//        }
//    }
//}